import requests
from utils.ip import get_proxy
from utils import ip
proxies = get_proxy()
i = 0
while True:
    try:
        res = requests.get(f"https://httpbin.org/get?age={i}",proxies=proxies)
        print(res.status_code)
        print(res.json())
        print(proxies)
        i += 1
        if i == 100:
            break
    except requests.exceptions.ProxyError as e:
        print(f"代理异常 错误原因{e}")
        new_proxies = get_proxy()
        proxies = new_proxies
    except Exception as e:
        print(f"请求地址失败 错误原因{e}")


